public class ThreadDemo6 {
    public static void main(String[] args) {
        Thread t1 = new Thread(){
            @Override
            public void run() {
                while (true){
                    System.out.println("线程t1正在运行...");
                    //Thread.yield();
                }
            }
        };
        Thread t2 = new Thread(){
            @Override
            public void run() {
                while(true){
                    System.out.println("线程t2正在运行...");
                }
            }
        };
        t1.start();
        t2.start();
    }
}
